<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div style="width:600px; text-align:center; font-weight:bold;font-size:30px;">
		在线问答
	</div>
	<div style="width:600px; text-align:center;">
		<a href="question">我要提问</a>
	</div>
	<table border="1" width="600">
		<tr style="background:gray">
			<th>序号</th>
			<th>问题</th>
			<th>回答次数</th>
			<th>最后修改</th>
		</tr>
		<c:forEach items="${requestScope.list }" var="ques" varStatus="status">
			<tr <c:if test="${status.index%2!=0 }">style="background:gray"</c:if> >
				<td>${ques.id }</td>
				<td>
					<c:if test="${ques.answerCount==0 }">
						<a href="showDetails/${ques.id }" style="color:red;">${ques.title }</a>
					</c:if>
					<c:if test="${ques.answerCount!=0 }">
						<a href="showDetails/${ques.id }">${ques.title }</a>
					</c:if>
				</td>
				<td>${ques.answerCount }</td>
				<td>
					<fmt:formatDate value="${ques.lastModified }" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>